<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时间</title>
    <style>
        p{
            text-align: center;
            font-size: 100px;
            color: red;
            margin-top: 100px;
        }
    </style>
</head>
<body>
<b>
    <p id="clock"></p>
</b>


</body>
</html>
<script>
    //4. 结合定时器在网页上显示会走的时间
    function showTime(){
        var time=new Date();
        time = time.toLocaleString();
        var clock = document.getElementById("clock").innerHTML=time;
    }
    setInterval(showTime,1000)
</script>